﻿using System;
using System.Windows;
using Microsoft.Win32;
namespace GoogleReaderToDelicious.WPF.Framework
{
    //21-Nov-2011 Priyan R
    public class FrameworkUtility
    {
        public static void ShowOpenFileDialog(string filterString, Action<string> onSelected,
                Action onCancelled)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            // Show all files
            dlg.Filter = filterString;
            if (dlg.ShowDialog().Value)
            {
                onSelected(dlg.FileName);
            }
            else
            {
                onCancelled();
            }
        }
        public  static void Confirm(string message,Action<bool> callback)
        {
            callback(MessageBox.Show(message, "Confirm", MessageBoxButton.OKCancel)==MessageBoxResult.OK);
        }
    }
}
